.PHONY: help build publish

NAME:=mysql5.5
IMAGE:=registry.cn-hangzhou.aliyuncs.com/xiaokang/mysql5.5
VERSION:=$(shell cat VERSION)
# Terminal coloring
BOLD:=$$(tput bold)
GREEN:=$$(tput setaf 2)
RED:=$$(tput setaf 1)
CLEAR:=$$(tput sgr 0)

REGISTRY_HOST?=registry.cn-hangzhou.aliyuncs.com
REGISTRY_USERNAME?=
REGISTRY_PASSWORD?=
DOCKER_HUB_HOST?=

## Global commands
help:
	@echo "$(BOLD)Name:$(NAME)"
	@echo
	@echo "$(BOLD)Global commands:$(CLEAR)"
	@echo "  $(BOLD)$(GREEN)help$(CLEAR)    Display this menu."
	@echo
	@echo "$(BOLD)Workstation commands:$(CLEAR)"
	@echo "  $(BOLD)$(GREEN)build$(CLEAR)      Build all tool images."
	@echo

build:
	@echo "$(BOLD)$(GREEN)Building $(IMAGE) image...$(CLEAR)"
	@docker build -t $(IMAGE):$(VERSION) .
	@echo "$(BOLD)$(GREEN)Image $(IMAGE) was built.$(CLEAR)"

